package com.top.art.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.top.art.bo.StudioCourseBO;
import com.top.art.entity.Aggregation;
import com.top.art.entity.ExaminationPaper;
import com.top.art.vo.PaperScoreVO;
import com.top.art.vo.ScoreVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author hjh
 * @since 2020 -10-05
 */
@Repository
public interface ExaminationPaperMapper extends BaseMapper<ExaminationPaper> {

    /**
     * Aggregation list.
     *
     * @param wrapper the wrapper
     * @return the list
     */
    @Select("select grade, COUNT(0) AS `count` from t_examination_paper ${ew.customSqlSegment} GROUP BY grade")
    List<Aggregation> aggregation(@Param(Constants.WRAPPER) Wrapper<ExaminationPaper> wrapper);

    List<ScoreVO> queryScoreByCode(String admissionTicketCode );


    List<PaperScoreVO> queryPaperDetail(StudioCourseBO bo);

    List<ExaminationPaper> selectByStudioCode(String studioCode);

    List<Map<String, Object>> countByStudioCode(String studioCode);

    List<String> selectCourse();

}
